<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<script>
	var ctx = "${ctx}";
</script>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />

	<link href="${ctx}/static/css/bootstrap.css?v=${static_version}/" rel="stylesheet">
  	<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.css" rel="stylesheet" >
	<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/font-awesome.min.css" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<link href="${ctx}/static/css/plugins/summernote/summernote.css?v=${static_version}/" rel="stylesheet">
	<link href="${ctx}/static/css/plugins/summernote/summernote-bs3.css?v=${static_version}/" rel="stylesheet">
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/webuploader/webuploader.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/markdown/bootstrap-markdown.min.css" rel="stylesheet" />
<title>发布赛事</title>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content  animated fadeInRight">
		<div class="ibox float-e-margins">	
			<div class="ibox-title">
			    <h5>发布赛事<small>&nbsp;&nbsp;&nbsp;&nbsp;基本信息</small></h5>
			</div>
             
             
             
	<form action="${ctx}/views/u_match-info-add" method="post" class="form form-horizontal" id="form-u_match-add">	
		<div class="ibox-content">	
			<input type="hidden" id="id" name="id" value='${u_match.match_id}' />
	        <input type="hidden" id="match_id" name="match_id" value='${u_match.match_id}' />
	        <input type="hidden" id="web_path" name="web_path" value='${ctx}' />
        
			<div class="form-group">
            	<label class="col-sm-2 control-label">赛事分类：</label>
            	
			    <div class="col-sm-2">
			        <select name="match_cate" class="input-md form-control chosen-select" tabindex="4">
						<c:forEach items="${match_cates_list}" var="cate">
						<option value="${cate.item_value}" 
							<c:if test="${u_match.match_cate==cate.item_value}">selected</c:if>>${cate.display_name}
						</option>					
						</c:forEach>
					</select>		
				</div>
			</div>
			
        	<div class="form-group">
            	<label class="col-sm-2 control-label">赛事名：</label>           	
			    <div class="col-sm-2">
                	<input type="text" class="form-control" value="${u_match.match_name}" placeholder="" id="" name="match_name" datatype="*" nullmsg="不能为空">
        		</div>
			</div>

	        <div class="form-group">
				<label class="col-sm-2 control-label">赛事介绍：</label>
	        	<input type="hidden" id="match_introduce" name ="match_introduce" >
				<div class="col-sm-2">
			 		<div id="summernote" class="form-control">${u_match.match_introduce}</div>
			 	</div>	
			</div>
			
	        <div class="form-group">
				<label class="col-sm-2 control-label">赛事规则介绍：</label>
	            <div class="col-sm-2">
	                 <textarea class="form-control" name="match_rules" datatype="*" nullmsg="不能为空">${u_match.match_rules}</textarea>
	        	</div>
			</div>
			
			 <div class="form-group">
				<label class="col-sm-2 control-label">赛事缩略图：</label>
	            <div class="col-sm-2">
	                <div id="fileList_pre" class="uploader-list"></div>
					<div id="filePicker_pre">选择图片</div>
					<input type="hidden" class="input-text"
					value="${u_match.thumbnail}" placeholder=""
					id="thumbnail" name="thumbnail">
					<c:if test="${u_match.thumbnail != ''}">
						<div>
							<img id= "show_thumb" src = "${u_match.thumbnail}" style="width:100px; height:100px"/>
						</div>
					</c:if>
	        	</div>
			</div>
						
	        <div class="form-group">
				<label class="col-sm-2 control-label">缩略图H5：</label>
	            <div class="col-sm-2">
	            	<input type="text" class="form-control" value="${u_match.thumbnail_h5}" placeholder="" id="" name="thumbnail_h5" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			
	        <div class="form-group">
				<label class="col-sm-2 control-label">报名起止时间：</label>
	            <div class="col-sm-2">
	                <input type="text"  class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" 
	                	value="${u_match.pstart_time}" placeholder="" id="" name="pstart_time" datatype="*" nullmsg="不能为空">
	        	</div>
			
				<label class="col-sm-2 control-label">至：</label>
	            <div class="col-sm-2">
	                <input type="text"  class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  
	                	value="${u_match.pend_time}" placeholder="" id="" name="pend_time" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			
	        <div class="form-group">
				<label class="col-sm-2 control-label">投票起止时间：</label>
	            <div class="col-sm-2">
	                <input type="text" class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
	                	value="${u_match.vstart_time}" placeholder="" id="" name="vstart_time" datatype="*" nullmsg="不能为空">
	        	</div>
			
				<label class="col-sm-2 control-label">至：</label>
	            <div class="col-sm-2">
	                <input type="text" class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" 
	                	value="${u_match.vend_time}" placeholder="" id="" name="vend_time" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			
	        <div class="form-group">
				<label class="col-sm-2 control-label">结果公布时间：</label>
	            <div class="col-sm-2">
	                <input type="text"  class="form-control Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  
	                	value="${u_match.result_time}" placeholder="" id="" name="result_time" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			
	 		<div class="form-group"></div>
			<div class="cl pd-5 bg-1 bk-gray"> 		
				<div class="btn btn-default btn-warning title rleft def" style="width:100%">奖项设定</div>			
			 </div>
	
			<div class="form form-horizontal">
	         <div class="form-group">
				<label class="col-sm-2 control-label">奖金总额 ：</label>
	             <div class="col-sm-2">
	                <input type="text" class="form-control" value="${u_match.bonus_amount}" placeholder="" id="" name="bonus_amount" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			 <div class="form-group">
				<label class="col-sm-2 control-label">平台收费 ：</label>
	            <div class="col-sm-2">
	                <input type="text" class="form-control" value="${u_match.counter_fee}" placeholder="" id="" name="counter_fee" datatype="*" nullmsg="不能为空">
	        	平台收取赛事总金额  10  ％
	        	</div>
	        
			</div> 
			     
	        <div class="form-group">
				<label class="col-sm-2 control-label">获奖金额：</label>
	            <div class="col-sm-2">
	                <input type="text" class="form-control" value="${u_match.win_amount}" placeholder="" id="" name="win_amount" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
	        <div class="form-group">
				<label class="col-sm-2 control-label">竞猜金额 ：</label>
	             <div class="col-sm-2">
	                <input type="text" class="form-control" value="${u_match.guess_amount}" placeholder="" id="" name="guess_amount" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">参赛名额 ：</label>
	             <div class="col-sm-2">
	                <input type="text" class="form-control" value="${u_match.join_count}" placeholder="" id="" name="join_count" datatype="*" nullmsg="不能为空">
	        	</div>
			</div>
			
			 <div class="form-group">
				<label class="col-sm-2 control-label">奖项设置 ：</label>
				<div style="width:70%;margin-left: 10px" class="col-sm-2">		 
				<table
					class="table table-border table-bordered table-hover table-bg table-sort" id="charge">
					<thead>
						<tr class="text-c">
							<th style="width:15%">奖项等级</th>                        
	                        <th style="width:15%">奖项名称</th>                            
							<th style="width:15%">获奖人数</th>                           
							<th style="width:15%">奖金比例</th>                      
							<th style="width:15%">奖金（元）</th>
							<th style="width:25%">其他</th>
							<th style="width:15%">操作</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach items="${list_match_prize}" var="prize_info">
						<tr class="text-c">
								<td>
									<input type='text'
									class='input-text' 
									name='prize_num'  nullmsg='不能为空'
									value="${prize_info.prize_num}">
								</td>
								<td>
									<input type='text'
									class='input-text' 
									name='prize_name'  nullmsg='不能为空'
									value="${prize_info.prize_name}">
								</td>
									
								<td>
									<input type='text'
									class='input-text'  name='winner_count' datatype='n'
									value="${prize_info.winner_count}">
								</td>
									
								<td>
									<input type='text'
									class='input-text'  style='min-width: 10px'
									name='prize_percent' datatype='n1-100' nullmsg='不能为空并且必须是整数'
									value="${prize_info.prize_percent}">
								</td>
									
								<td >
									<input type="text"  name="prize_money" value="${prize_info.prize_money}" 
									class='input-text'  >	
								</td>	
								
								<td>
									<input type="text"  name="remark" value="${prize_info.remark}" 
									class='input-text' >	
								</td>
								<td>
									<button class='btn btn-warning radius' type='button' onClick="prize_disable(this)">
									<i class='fa fa-remove'>&#xe632;</i> 删除</button>
								</td>													
							</tr>
						</c:forEach>		
					</tbody>
				</table>
				</div>
			</div>
		    <div class="row">
				<button
					onClick="add_new_charge();" class="btn btn-primary radius"
					type="button">
					<i class="Hui-iconfont">&#xe632;</i>添加奖项等级
				</button><label class="form-label col-xs-4 col-sm-3"></label>
			</div>
	        <div class="row cl">
				<label class="col-sm-2 control-label">是否需要佐证视频：</label>
	            <div class="formControls col-2">
	              	<input type="radio" name="is_need_vedio" value="1" id="is_need_vedio"  <c:if test="${u_match.is_need_vedio==1}">checked</c:if> ><label>是</label>
					<input type="radio" name="is_need_vedio" value="2" id="is_need_vedio"  <c:if test="${u_match.is_need_vedio==2}">checked</c:if> ><label>否</label>
	        	</div>
			</div>
	  	</div>
        
		<div class="row">
			<div class="col-10 col-offset-2 text-center">
				<button onClick="u_match_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
			</div>
		</div>
	</div>
	</form>
</div>
</div>
	<script src="${ctx}/static/js/jquery.min.js"></script>
	<script src="${ctx}/static/js/bootstrap.min.js"></script>
	<!-- 插件脚本 -->
	<script src="${ctx}/static/js/plugins/layer/layer.js"></script>	
	<script src="${ctx}/static/js/jquery.form.js"></script>
	<script src="${ctx}/static/js/plugins/webuploader/webuploader.min.js"></script>
	<script src="${ctx}/static/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="${ctx}/static/js/Validform/5.3.2/Validform.min.js"></script>
	<script src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>	
    <script src="${ctx}/static/js/plugins/summernote/summernote.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/summernote/summernote-zh-CN.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/uthinkjs/u_match.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#summernote').summernote({
		height: 150    
	});
});


function prize_disable(obj){
	$(obj).parent().parent().remove();
}
var web_path = '${ctx}';
</script>
</body>
</html>

